<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $this->assign('title','妈妈好菜');
        $this->display();
    }

    /**
     * @函数    quit
     * @功能    登出账户，跳转至首页。并清除Session
     */
    function quit()
    {
        session(null); //清空所有session信息
        setcookie("username",$_SESSION['username'],time()-3600);
        setcookie("ShortName",$_SESSION['username'],time()-3600);
        redirect(U('/index'), 0, '首页');
    }

}